import Vue from 'vue'
import App from './App'
import uView from "uview-ui"

// 引入uView
Vue.use(uView)

Vue.config.productionTip = false

App.mpType = 'app'

Vue.prototype.$mz = {
	checkSession() {
		return new Promise((resolve, reject) => {
			uni.checkSession({
				success(res) {
					resolve(res)
				},
				fail(err) {
					reject(err)
				}
			})
		})
	},
	pleaseLogin(isMinePgge) {
		uni.showModal({
			title: '请先登录',
			content: '登录后才可使用该功能',
			success: function(res) {
				if (res.confirm) {
					if (isMinePgge === undefined) {
						uni.switchTab({
							url: '../mine/mine'
						});
					}
				}
			}
		});
	},
	// 小程序原始ID
	yuanshiId: 'gh_df9cb4c9598c'
}

const app = new Vue({
	...App
})
app.$mount()
